<template>
  <div class="about">
    <h1>绑定值msg:{{ msg }}</h1>
    <van-search v-model="value" placeholder="请输入搜索关键词" />
  </div>
</template>

<script lang="ts" setup>
import { Button, Rate, Search } from 'vant';

//因为这里用了script的setup方式就用不到 defineComponent 这个定义组件的api了
import { useSlots, useAttrs, defineProps, onMounted, watchEffect, ref, defineComponent } from 'vue';

// 跳路由用
import router from '@/router/index';
// 获取路由参数
import { useRoute } from 'vue-router';

const route = useRoute();
const slots = useSlots();
const attrs = useAttrs();

const value = ref('');

//获取子组件传的值
const props = defineProps({
  idq: String,
});

const msg = 1234;

onMounted(() => {
  console.log('onMounted:', 123444);
});

//watchEffect 会最先执行 自动收集里面的依赖更新调用
watchEffect(() => {
  console.log('watchEffect:', 3333);
});

//console.log(slots, attrs);
//console.log('props', props);
//console.log('route:', route.query);
</script>
